﻿using System;

public class Rectangle : IComparable<Rectangle>, ICloneable
{
    public int X { get; set; }
    public int Y { get; set; }
    public uint Width { get; set; }
    public uint Height { get; set; }

    public uint Area
    {
        get
        {
            return Width * Height;
        }
    }

    public Rectangle(int x, int y, uint width, uint height)
    {
        this.X = x;
        this.Y = y;
        this.Width = width;
        this.Height = height;
    }

    public Rectangle()
        : this(0, 0, 0, 0)
    { }

    public object Clone()
    {
        Rectangle result = new Rectangle(this.X, this.Y, this.Width, this.Height);
        return result;
    }

    public int CompareTo(Rectangle other)
    {
        return this.Area.CompareTo(other.Area);
    }
}

